var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var BundleConfig = require("AA_BundleConfig");
var EventManager = require("AA_EventManager");
var ResKeeper = require("AA_ResKeeper");
var EvenType = require("AA_EvenType");
var BossComming = require("AA_BossComming");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
_decorator.property;

var _def_UI_ShowBossTip = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.nowNode = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onEnable = function () {
    EventManager.EventMgr.addEventListener(EvenType.EVENT_TYPE.GAME_SHOW_BOOS, this.showAni, this);
  };
  _creator.prototype.onDisable = function () {
    EventManager.EventMgr.rmEventListener(EvenType.EVENT_TYPE.GAME_SHOW_BOOS, this.showAni, this);
  };
  _creator.prototype.showAni = function () {
    return __awaiter(this, undefined, undefined, function () {
      var e;
      return __generator(this, function (t) {
        switch (t.label) {
          case 0:
            if (this.nowNode) {
              return [3, 2];
            } else {
              return [4, this._loadRes(BundleConfig.BundleNames.Game, "game/" + "prefabs/BossComming", cc.Prefab)];
            }
          case 1:
            e = t.sent();
            this.nowNode = cc.instantiate(e);
            this.node.addChild(this.nowNode);
            t.label = 2;
          case 2:
            this.nowNode.getComponent(BossComming.default).showAni();
            return [2];
        }
      });
    });
  };
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UI_ShowBossTip;